function twoSum(nums: number[], target: number): number[] {
    let res: number[] = [];
    for (let i = 0; i <= nums.length; i++) {
        let isBreak = false;
        for (let j = i+1; j < nums.length; j++) {
            if (nums[i] + nums[j] === target) {
                res = [i, j];
                isBreak = true;
                break;
            }
        }
        if (isBreak) {
            break;
        }
    }
    return res;
};